package com.gitee.wsl.struct.product.money.pay

import kotlin.time.ExperimentalTime
import kotlin.time.Instant

@OptIn(ExperimentalTime::class)
data class Rate(
    val vatInclusivePrice: Double,
    val validity: ClosedRange<Instant>, // Caller should end using Instant.DISTANT_FUTURE if API returns null
    val paymentMethod: PaymentMethod,
) {
    fun isActive(referencePoint: Instant): Boolean {
        return validity.contains(referencePoint)
    }
}